package com.hqd.ch03.v51.boot.web.server;

/**
 * Web容器接口
 */
public interface WebServer {
    /**
     * 启动Web容器
     */
    void start() throws WebServerException;

    /**
     * 暂停Web容器
     */
    void stop() throws WebServerException;

    /**
     * 获取端口
     */
    int getPort();

    /**
     * 关闭回调
     */
    default void shutDownGracefully(GracefulShutdownCallback callback) {
        callback.shutdownComplete(GracefulShutdownResult.IMMEDIATE);
    }

}